package com.beidasoft.web.util.enums;

/**
 * @Author songff
 * @MethodName
 * @Description //TODO
 * @Date 11:31 2020/3/27
 * @Param
 * @return 检查 --转-- 处罚
 * 居民身份证 01 -- 01
 * 驾驶证 02 -- 02
 * 护照 03 -- 04
 * 港澳居民来往内地通行证 04 -- 06
 * 台湾居民来往大陆通行证 05 -- 08
 * 军官证 06 -- 03
 * 士兵证 07 -- 07
 * 其他 99 -- 05
 **/
public enum CardTypeEnum {

    CARD_TYPE_01("01", "01", "居民身份证"),
    CARD_TYPE_02("02", "02", "驾驶证"),
    CARD_TYPE_03("03", "04", "护照"),
    CARD_TYPE_04("04", "06", "港澳居民来往内地通行证"),
    CARD_TYPE_05("05", "08", "台湾居民来往大陆通行证"),
    CARD_TYPE_06("06", "03", "军官证"),
    CARD_TYPE_07("07", "07", "士兵证"),
    CARD_TYPE_99("99", "05", "其他");

    private String code;//检查代码值
    private String type;//处罚代码值
    private String name;

    public String getCode() {
        return code;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    CardTypeEnum(String code, String type, String name) {
        this.code = code;
        this.type = type;
        this.name = name;
    }

    /**
     * @return java.lang.Integer
     * @Author songff
     * @MethodName getTypeByCode
     * @Description //TODO 通过检查的证件类型代码值，获取处罚的证件类型代码值
     * @Date 21:26 2020/3/26
     * @Param [code]
     **/
    public static String getTypeByCode(String code) {
        switch (code) {
            case "01":
                return CARD_TYPE_01.type;
            case "02":
                return CARD_TYPE_02.type;
            case "03":
                return CARD_TYPE_03.type;
            case "04":
                return CARD_TYPE_04.type;
            case "05":
                return CARD_TYPE_05.type;
            case "06":
                return CARD_TYPE_06.type;
            case "07":
                return CARD_TYPE_07.type;
            case "99":
                return CARD_TYPE_99.type;
            default:
                return null;
        }
    }

    /**
     * @return java.lang.String
     * @Author songff
     * @MethodName getCodeByType
     * @Description //TODO 通过处罚的证件类型代码值，或者检查的代码值
     * @Date 21:27 2020/3/26
     * @Param [type]
     **/
    public static String getCodeByType(String type) {
        switch (type) {
            case "01":
                return CARD_TYPE_01.code;
            case "02":
                return CARD_TYPE_02.code;
            case "03":
                return CARD_TYPE_06.code;
            case "04":
                return CARD_TYPE_03.code;
            case "05":
                return CARD_TYPE_99.code;
            case "06":
                return CARD_TYPE_04.code;
            case "07":
                return CARD_TYPE_07.code;
            case "08":
                return CARD_TYPE_05.code;
            default:
                return null;
        }
    }

    /**
     * @return java.lang.String
     * @Author songff
     * @MethodName getNameByTypeOrCode
     * @Description //TODO  通过检查的证件类型代码值，获取证件类型中文代码值
     * @Date 11:56 2020/3/27
     * @Param [type]
     **/
    public static String getNameByCode(String code) {
        switch (code) {
            case "01":
                return CARD_TYPE_01.name;
            case "02":
                return CARD_TYPE_02.name;
            case "03":
                return CARD_TYPE_03.name;
            case "04":
                return CARD_TYPE_04.name;
            case "05":
                return CARD_TYPE_05.name;
            case "06":
                return CARD_TYPE_06.name;
            case "07":
                return CARD_TYPE_07.name;
            case "99":
                return CARD_TYPE_99.name;
            default:
                return null;
        }
    }

}
